package com.bymboy.emos.wx.config.shiro;

import org.springframework.stereotype.Component;

/**
 * @Package: com.bymboy.emos.wx.config.shiro
 * @ClassName: ThreadLocalToken
 * @Author: My
 * @CreateTime: 2021/9/2 11:40
 * @Description:
 */
@Component
public class ThreadLocalToken {
    private ThreadLocal<String> local = new ThreadLocal<>();

    public void setToken(String token) {
        local.set(token);
    }

    public String getToken() {
        return local.get();
    }

    public void clear() {
        local.remove();
    }
}
